﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Twi.COMMON.Core;

namespace Twi.Test.COMMON.Core
{
    [TestClass()]
    public class SimpleTest
    {
        private TestContext testContextInstance;

        /// <summary>
        ///获取或设置测试上下文，上下文提供
        ///有关当前测试运行及其功能的信息。
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        [TestMethod]
        public void ChartDataModelToJsonStr()
        {
            List<ChartDataModel<Double>> list = new List<ChartDataModel<Double>>();
            ChartDataModel<Double> model = new ChartDataModel<Double>();
            model.ID = "1";
            model.categories.Add("2013-10-01");
            model.categories.Add("2013-10-02");
            model.AddSeries("Tokyo", new List<Double>() {49.9, 71.5, 18});
            list.Add(model);


            ChartDataModel<Double> model2 = new ChartDataModel<Double>();
            model2.ID = "1";
            model2.categories.Add("2013-10-03");
            model2.categories.Add("2013-10-04");
            model2.AddSeries("England", new List<Double>() { 50, 78, 10 });
            list.Add(model2);

            string str = JSSerialize.Serialize(list);
            Assert.Inconclusive("验证此测试方法的正确性");
        }

        [TestMethod]
        public void ChartDataModelToJsonStr2()
        {
            ChartDataModel<double> cdModel = new ChartDataModel<double>();
            cdModel.AddPieSeriesItem("现金", 70.0);
            cdModel.AddPieSeriesItem("银行卡", 30.0);

            string str = JSSerialize.Serialize(cdModel);
            Assert.Inconclusive("验证此测试方法的正确性");
        }
    }
}
